package af;
public class sad {

	public static void main(String[] args) {
		int[] a= {10,20,50,30,40,85};
		printArray(a);
		System.out.println();
		printArray(arr(a));
	}
	public static int[] arr(int[]a){
		int temp;
		for (int k = 0; k < a.length; k++) {
			for (int i = 0; i < a.length-1; i++) {
					if(a[i]<a[i+1]) {
						temp=a[i];
						a[i]=a[i+1];
						a[i+1]=temp;

				}
			}	
		}
	
		return a;
	}
	
	public static void printArray(int [] a) {
		System.out.print("[");
		for (int i = 0; i < a.length; i++) {
			if (i==a.length-1) {
				System.out.print(a[i]);
			}else {
				System.out.print(a[i]+",");
			}
		}
		System.out.print("]");
	}
}